<?php
use yii\helpers\url;
?>
<?= '<link rel="stylesheet" type="text/css" href="./ass/p/list/list.css?v='.date('Ymt').'"/>' ;?>
<div class="content">
    <div class="box-head">
        <span class="width4">排序</span>
        <span class="width14">标题</span>
        <span class="width9">分类</span>
        <span class="width20">状态</span>
        <span class="width12 ">创建时间</span>
        <span class="width12 ">上次修改</span>
        <span class="width14">操作</span>
        <span class="width14 text-r float-r">批量
            <select class="input-select float-r" name="status">
                <option value="-1" selected = "selected" >选择</option>
                <option value="2">正常</option>
                <option value="3">热点</option>
                <option value="1">草稿</option>
                <option value="0">删除</option>
            </select>
        </span>
    </div>
    <ul class="list">
        <?php if($model):?>
            <?php foreach($model as $key=>$val):?>
                <li>
                    <p class="width4"><?= $key+($data['nowpage']-1)*$data['limits']+1; ?></p>
                    <p class="width14"><?= $val['title']; ?></p>
                    <p class="width9 red"><?= $val['category'];?></p>
                    <p class="width20">
                        <span class="state<?php if($val['status']==2){echo' states';}?>" name="2">
                            <span class="state-off state-normal"></span>
                            <span>正常</span>
                        </span>
                        <script></script>
                        <span class="state<?php if($val['status']==1){echo' states';}?>" name="1">
                            <span class="state-off state-draft"></span>
                            <span>草稿</span>
                        </span>
                        <span class="state<?php if($val['status']==3){echo' states';}?>" name="3">
                            <span class="state-off state-hot"></span>
                            <span>热点</span>
                        </span>
                    </p>
                    <p class="width12"><?= date('Y-m-d',$val['create_time']); ?></p>
                    <p class="width12"><?= $val['modify_time']? date('Y-m-d',$val['modify_time']) :'未曾修改'; ?></p>
                    <p class="width14">
                        <a class="delete-one" href="<?= \yii\helpers\Url::to(['/article/delete','id'=>$val['id'],'page'=>$data['nowpage']]); ?>">
                            <i class="iconfont">&#xe600;</i>
                        </a>
                        <a class="update-one" href="<?= \yii\helpers\Url::to(['/editor/update','id'=>$val['id'],'page'=>$data['nowpage']]); ?>">
                            <i class="iconfont">&#xe611;</i>
                        </a>
                    </p>
                    <p class="width14 checkbox checkbox-off float-r">
                        <input type="hidden" name="<?= $val['id']?>" value="0">
                    </p>
                </li>
            <?php endforeach;?>
        <?php endif;?>
    </ul>
    <div class="box-footer">
        <ul class="page float-l">
            <li><a href="<?= Url::to(['/article','page'=>$data['backpage']]); ?>"><i class="iconfont">&#xe607;</i></a></li>
            <?php for($i=1 ; $i<=$data['page'] ; $i++):?>
                <?php if($data['nowpage']==$i):?>
                    <li><a href="<?= Url::to(['/article','page'=>$i]); ?>" class="page-o"><?= $i;?></a></li>
                <?php else:?>
                    <li><a href="<?= Url::to(['/article','page'=>$i]); ?>" class="page-n"><?= $i;?></a></li>
                <?php endif?>
            <?php endfor;?>
            <li><a href="<?= Url::to(['/article','page'=>$data['frontpage']]); ?>"><i class="iconfont">&#xe606;</i></a></li>
        </ul>
        <div class="box-footer-button">
            <a href="javascript:void(0)" id="delete" class="update-action"><i class="iconfont">&#xe60e;</i><br/><span>批量操作</span></a>
<!--            <a href="--><?//= Url::to(['/articlect/index']); ?><!--" class="add-class"><i class="iconfont">&#xe613;</i><br/><span>添加分类</span></a>-->
            <a href="<?= Url::to(['/editor/index']); ?>" class="add-action"><i class="iconfont">&#xe612;</i><br/><span>添加文章</span></a>
            <span class="red hint"></span>
        </div>
    </div>
</div>
</body>
</html>
